#ifndef  __TIMER_H__
#define  __TIMER_H__


#define   TIMER_NUMBER                   (10)

#define   TIMER_NO_ERR                   (0x01)
#define   TIMER_ERR_NO_MORE_TIMERS       (0x02)
#define   TIMER_START_ERR                (0x03)

typedef struct _timer
{
   INT32U  TimCount;
   INT32U  TimLimit;
   INT8U   TimState;
   
}TIMER;


typedef  struct _rtc_timer
{
  INT8U  Ticks;
  INT32U Time_s;
}RTC_TIMER;

void   Timer_Init(void);
INT8U  Timer_Apply(INT32U Time_ms , INT8U* err);
INT8U  StartTimer(INT8U TimeID);
INT8U  isTimeOver(INT8U TimeID);
void   StopTimer(INT8U TimeID);
void   DelTimer(INT8U TimeID);
TIMER* GetTimerHandle(INT8U TimeID);
INT32U GetRTCTime(void);
void   SetRTCTime(INT32U Time);

#endif